# A treemap R script produced by the REVIGO server at http://revigo.irb.hr/ # If you found REVIGO useful in your work, please cite the following reference: # Supek F et al. "REVIGO summarizes and visualizes long lists of Gene Ontology # terms" PLoS ONE 2011. doi:10.1371/journal.pone.0021800 # author: Anton Kratz , RIKEN Omics Science Center, Functional Genomics Technology Team, Japan # created: Fri, Nov 02, 2012 7:25:52 PM # last change: Fri, Nov 09, 2012 3:20:01 PM # ----------------------------------------------------------------------------- # If you don't have the treemap package installed, uncomment the following line: # install.packages( "treemap" ); library(treemap) # treemap package by Martijn Tennekes # Set the working directory if necessary # setwd("C:/Users/username/workingdir"); # -------------------------------------------------------------------------- # Here is your data from REVIGO. Scroll down for plot configuration options. revigo.names <- c("term_ID","description","freqInDbPercent","abslog10pvalue","uniqueness","dispensability","representative"); revigo.data <- rbind(c("GO:0006412","translation",4.967,23.1574,0.739,0.000,"translation"), c("GO:0009142","nucleoside triphosphate biosynthetic process",0.924,1.7901,0.566,0.223,"translation"), c("GO:0006414","translational elongation",0.665,4.8794,0.770,0.513,"translation"), c("GO:0006457","protein folding",0.973,3.3197,0.806,0.538,"translation"), c("GO:0043094","cellular metabolic compound salvage",0.248,1.3866,0.826,0.191,"translation"), c("GO:0009853","photorespiration",0.026,1.7208,0.843,0.153,"translation"), c("GO:0009415","response to water",0.029,1.7725,0.842,0.000,"response to water"), c("GO:0009414","response to water deprivation",0.020,1.7208,0.843,0.658,"response to water"), c("GO:0015992","proton transport",1.025,2.3149,0.852,0.000,"proton transport"), c("GO:0015031","protein transport",1.777,2.0398,0.773,0.318,"proton transport"), c("GO:0006818","hydrogen transport",1.025,2.3149,0.852,0.299,"proton transport"), c("GO:0048316","seed development",0.020,1.5117,0.815,0.000,"seed development"), c("GO:0007031","peroxisome organization",0.026,2.0567,0.908,0.022,"peroxisome organization"), c("GO:0044275","cellular carbohydrate catabolic process",0.982,1.3154,0.858,0.080,"cellular carbohydrate catabolism"), c("GO:0045333","cellular respiration",4.810,2.2245,0.759,0.081,"cellular respiration"), c("GO:0006091","generation of precursor metabolites and energy",6.142,2.5946,0.854,0.085,"generation of precursor metabolites and energy")); stuff <- data.frame(revigo.data); names(stuff) <- revigo.names; stuff$abslog10pvalue <- as.numeric( as.character(stuff$abslog10pvalue) ); stuff$freqInDbPercent <- as.numeric( as.character(stuff$freqInDbPercent) ); stuff$uniqueness <- as.numeric( as.character(stuff$uniqueness) ); stuff$dispensability <- as.numeric( as.character(stuff$dispensability) ); # by default, outputs to a PDF file pdf( file="revigo_treemap.pdf", width=16, height=9 ) # width and height are in inches # check the tmPlot command documentation for all possible parameters - there are a lot more tmPlot( stuff, index = c("representative","description"), vSize = "abslog10pvalue", type = "categorical", vColor = "representative", title = "REVIGO Gene Ontology treemap", inflate.labels = FALSE, # set this to TRUE for space-filling group labels - good for posters lowerbound.cex.labels = 0, # try to draw as many labels as possible (still, some small squares may not get a label) bg.labels = "#CCCCCCAA", # define background color of group labels # "#CCCCCC00" is fully transparent, "#CCCCCCAA" is semi-transparent grey, NA is opaque position.legend = "none" ) dev.off()